<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>src.processing.reliability_speed_indicator.Reliability_speed_indicator</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="src-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >ttrq4fleet - Petrina Papazek</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="src-module.html">Package&nbsp;src</a> ::
        <a href="src.processing-module.html">Package&nbsp;processing</a> ::
        <a href="src.processing.reliability_speed_indicator-module.html">Module&nbsp;reliability_speed_indicator</a> ::
        Class&nbsp;Reliability_speed_indicator
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="src.processing.reliability_speed_indicator.Reliability_speed_indicator-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Reliability_speed_indicator</h1><p class="nomargin-top"><span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_src_proc_25" name="uml_class_diagram_for_src_proc_25">
<area shape="rect" href="javascript:void(0);" title="??&#45;44" alt="" coords="109,11,144,43"/>
<area shape="rect" href="src.processing.reliability_speed_indicator.Reliability_speed_indicator-class.html#__init__" title="src.processing.reliability_speed_indicator.Reliability_speed_indicator.__init__" alt="" coords="17,97,236,116"/>
<area shape="rect" href="src.processing.reliability_speed_indicator.Reliability_speed_indicator-class.html" title="This class is abstract and represents a reliability indicator for measured speeds." alt="" coords="16,72,237,117"/>
</map>
  <img src="uml_class_diagram_for_src_proc_25.gif" alt='' usemap="#uml_class_diagram_for_src_proc_25" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>This class is abstract and represents a reliability indicator for 
  measured speeds.</p>
  <p>The indicators use the aggregated fleet data and the timeseries for 
  the calulation of indicator values.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="src.processing.reliability_speed_indicator.Reliability_speed_indicator-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">data</span>,
        <span class="summary-sig-arg">timeseries</span>=<span class="summary-sig-default">None</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="src.processing.reliability_speed_indicator.Reliability_speed_indicator-class.html#_ts_P5_speed" class="summary-sig-name" onclick="show_private();">_ts_P5_speed</a>(<span class="summary-sig-arg">self</span>)</span><br />
      calculates the 5th percentile of speeds using the standard deviation from the timeseries for every time interval.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._ts_P5_speed">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="src.processing.reliability_speed_indicator.Reliability_speed_indicator-class.html#_ts_stddev_speed" class="summary-sig-name" onclick="show_private();">_ts_stddev_speed</a>(<span class="summary-sig-arg">self</span>)</span><br />
      calculates the standard deviation of speeds using the standard 
      deviation from the timeseries for every time interval.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._ts_stddev_speed">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="src.processing.reliability_speed_indicator.Reliability_speed_indicator-class.html#_calc_stddev_speed" class="summary-sig-name" onclick="show_private();">_calc_stddev_speed</a>(<span class="summary-sig-arg">self</span>)</span><br />
      calculates the standard deviation of speeds for every time interval 
      by calling the methods of the variance</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._calc_stddev_speed">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="src.processing.reliability_speed_indicator.Reliability_speed_indicator-class.html#_calc_var_speed" class="summary-sig-name" onclick="show_private();">_calc_var_speed</a>(<span class="summary-sig-arg">self</span>)</span><br />
      calculates the variance of speed value for all intervals</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._calc_var_speed">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="src.processing.reliability_speed_indicator.Reliability_speed_indicator-class.html#_calc_average_speed" class="summary-sig-name" onclick="show_private();">_calc_average_speed</a>(<span class="summary-sig-arg">self</span>)</span><br />
      calculates the average speed value for all intervals</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._calc_average_speed">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="src.processing.reliability_speed_indicator.Reliability_speed_indicator-class.html#_calc_percentile_speed" class="summary-sig-name" onclick="show_private();">_calc_percentile_speed</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">p</span>)</span><br />
      calculates the pth percentile of the speed values for each time 
      interval</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._calc_percentile_speed">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">data</span>,
        <span class="sig-arg">timeseries</span>=<span class="sig-default">None</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>data</code></strong> - record-list-object containing sorted data for one link</li>
        <li><strong class="pname"><code>timeseries</code></strong> - record-list-object with timeseries (in order to get the standard 
          deviation for each time interval)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="_ts_P5_speed"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_ts_P5_speed</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._ts_P5_speed">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <pre class="literalblock">

calculates the 5th percentile of speeds using the standard deviation from the timeseries for every time interval.

If there is no data on a specific time interval the value is set to None.
If there are no timeseries the method will raise an error. 

Following formula is applied to calculate the P:
    P05_v_i = v_avg_i - 1.96 * std_i
        - p05_v_i ... 5th percentile of speeds for the time interval i
        - v_avg ... harmonic speed provided by the Agg_record-object
        - std_i ... standard deviation at the time interval i
        
@return: values (numeric value of the percentile or None) in a list for every interval

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="_ts_stddev_speed"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_ts_stddev_speed</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._ts_stddev_speed">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>calculates the standard deviation of speeds using the standard 
  deviation from the timeseries for every time interval.</p>
  <p>If the timeseries-object is None an error will be raised. If there is 
  no data on a specific time interval, the value on this interval is 
  None.</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>values (numeric value of the standard deviation or None) in a 
          list for every interval</dd>
  </dl>
</td></tr></table>
</div>
<a name="_calc_stddev_speed"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_calc_stddev_speed</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._calc_stddev_speed">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>calculates the standard deviation of speeds for every time interval by
  calling the methods of the variance</p>
  <p>This method uses regular aggregated fleet data 
  (fleet_traffic_state).</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>values (with the numeric value or None) for every time interval 
          as list</dd>
  </dl>
</td></tr></table>
</div>
<a name="_calc_var_speed"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_calc_var_speed</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._calc_var_speed">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>calculates the variance of speed value for all intervals</p>
  <p>This method uses regular aggregated fleet data 
  (fleet_traffic_state).</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>values (with the numeric value or None) for every time interval 
          as list</dd>
  </dl>
</td></tr></table>
</div>
<a name="_calc_average_speed"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_calc_average_speed</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._calc_average_speed">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>calculates the average speed value for all intervals</p>
  <p>This method uses regular aggregated fleet data 
  (fleet_traffic_state).</p>
  <dl class="fields">
    <dt>Returns:</dt>
        <dd>values (with the numeric value or None) for every time interval 
          as list</dd>
  </dl>
</td></tr></table>
</div>
<a name="_calc_percentile_speed"></a>
<div class="private">
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">_calc_percentile_speed</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">p</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="src.processing.reliability_speed_indicator-pysrc.html#Reliability_speed_indicator._calc_percentile_speed">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>calculates the pth percentile of the speed values for each time 
  interval</p>
  <p>This method uses regular aggregated fleet data 
  (fleet_traffic_state).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>p</code></strong> - percentile (e.g. 95 for the 95th speed percentile)</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>list with percentils (with the numeric value or None) for each 
          time interval</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="src-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >ttrq4fleet - Petrina Papazek</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Oct  8 17:34:01 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
